<template>
  <div>
    <h2>Category</h2>
    <EventBusCpns />
  </div>
</template>

<script setup>
  import { onMounted, onUnmounted } from 'vue'
  import eventBus from '../utils/event-bus.js'
  import EventBusCpns from './EventBusCpns.vue'

  const createEventHandler = (...args) => {
    console.log('createEventHandler', args);
  }

  onMounted(() => {
    eventBus.on('event-bus-name', createEventHandler)
  })

  onUnmounted(() => {
    eventBus.off('event-bus-name', createEventHandler)
  })

</script>

<style lang="scss" scoped></style>
